﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace QLTV.Forms.BaoMat
{
    public partial class frmLogin : DevExpress.XtraEditors.XtraForm
    {
        public frmLogin()
        {
            InitializeComponent();
           
        }
        public Boolean LogonSuccessful { get; set; }
     

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
        private void cmdLogin_Click(object sender, EventArgs e)
        {
            tblUsersTableAdapter1.login(dsUsers1.tblUsers, txtUserName.Text, txtPassword.Text);
            if (dsUsers1.tblUsers.Rows.Count > 0)
            {
                this.LogonSuccessful = true;
                Program.username = txtUserName.Text;
                if (comboBoxEdit1.SelectedIndex == 0)
                {
                    Program.language = "vi-VN";
                }
                else
                    Program.language = "en";
                this.Close();
            }
            else
                this.LogonSuccessful = false;
        }

        private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
        {
          
        }

        private void frmLogin_Load(object sender, EventArgs e)
        {
            txtUserName.Focus();
        }
     
    }
}